package vn.edu.hcmut.cse.ai.search.problems.blocksworld.predicate;

public class UnaryBlocksWorldPredicate extends BlocksWorldPredicate{

    protected int block;

    public UnaryBlocksWorldPredicate(int block) {
        super();
        this.block = block;
    }

    public int getBlock() {
        return block;
    }

    public void setBlock(int block) {
        this.block = block;
    }

    @Override
    public int hashCode() {
        return this.block * (this.getPredicateType() + 117);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final UnaryBlocksWorldPredicate other = (UnaryBlocksWorldPredicate) obj;
        return (this.block == other.block);
    }
}
